package com.ruoyi.common.utils;

import java.util.Random;

public class GenerateRandomCode {
    public static String getCode(int length) {
        // 生成指定长度的随机数字验证码
        Random random = new Random();
        StringBuilder code = new StringBuilder();
        for (int i = 0; i < length; i++) {
            code.append(random.nextInt(10));
        }
        return code.toString();
    }
}
